<ui:composition xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:f="http://java.sun.com/jsf/core" template="template/template.xhtml">
	<ui:define name="title">
		<h:outputText value="#{msgs.services}"/>
	</ui:define>
	<ui:define name="bodyInclude">
		<ui:include src="include/menu.xhtml" />
		<p:fieldset legend="#{msgs.services}" toggleable="true">
			<p:outputPanel layout="block" styleClass="container">
				<h:form id="servicesForm">
					<p:dataTable currentPageReportTemplate="{currentPage} #{msgs.of} {totalPages}" emptyMessage="#{msgs.emptyDataTableMessage}" id="servicesTable" paginator="true" paginatorAlwaysVisible="false" paginatorTemplate="{FirstPageLink} {PreviousPageLink} {CurrentPageReport}{PageLinks}{NextPageLink} {LastPageLink}" rows="10" rowsPerPageTemplate="5,10,20,50" selection="#{servicesAdministrationController.selectedServices}" value="#{servicesAdministrationController.services}" var="service">
						<p:column selectionMode="multiple"/>
						<p:column headerText="#{msgs.id}" sortBy="#{service.service.serviceId}" styleClass="center">
							<h:outputText value="#{service.service.serviceId}"/>
						</p:column>
						<p:column headerText="#{msgs.name}" sortBy="#{service.service.label}" styleClass="center">
							<h:outputText value="#{service.service.label}"/>
						</p:column>
						<p:column headerText="#{msgs.usersNb}" sortBy="#{service.usersNumber}" styleClass="center">
							<h:outputText value="#{service.usersNumber}"/>
						</p:column>
						<p:column headerText="#{msgs.lastHiredUser}" styleClass="center">
							<h:outputText rendered="#{null != service.lastHiredUser}" value="#{service.lastHiredUser.lastName} #{service.lastHiredUser.name}"/>
							<h:outputText rendered="#{null == service.lastHiredUser}" value="#{msgs.none}"/>
						</p:column>
					</p:dataTable>
					<p:outputPanel layout="block" styleClass="buttonContainer center">
						<p:commandButton actionListener="#{servicesAdministrationController.initServiceToCreate}" image="ui-icon ui-icon-circle-plus" oncomplete="dialogServiceCreationVar.show()" process="@this" update="serviceCreationForm" value="#{msgs.create}"/>
						<p:commandButton image="ui-icon ui-icon-circle-close" process="@this" value="#{msgs.delete}"/>
					</p:outputPanel>
				</h:form>
			</p:outputPanel>
		</p:fieldset>
		<ui:include src="dialog/dialogServiceCreation.xhtml" />
	</ui:define>
</ui:composition>